package Image;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

/**
 * description:
 * author:zcx
 * lenovo
 * 时间：2022.01.21.09.27
 */
public class Img2 {
    public static void main(String[] args) throws IOException {
        var i=new BufferedImage(500,500,2);
        var g=i.createGraphics();
        g.setColor(Color.BLUE);
        g.drawLine(0,0,500,500);
        g.dispose();
        ImageIO.write(i,"jpg",new File("i.jpg"));
        Runtime.getRuntime().exec("cmd /k start");
    }
}
